<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*" errorPage="errorPage.jsp"%>
<%@ page import="util.OnlineUsers"%>
<%@ page import="orm.*"%>
<% request.setCharacterEncoding("utf-8"); %>
<%
OnlineUsers onlineusers=OnlineUsers.getInstance();
User teacher = (User)session.getAttribute("Teacher");
Course course = (Course)session.getAttribute("Course");
if(course==null)
{
    System.out.println("course is null");
}
Vector olist=onlineusers.getMyTestingStus(teacher,course);
Vector alist= new Vector((List)session.getAttribute("MyStudents"));
System.out.println(olist.size()+" "+alist.size());
int amount=0;
%>
     <caption>
            监控中心
     </caption>
         <% for(int i=0;i<alist.size();i++)
             {
                 int j=0;
                 amount++;
                 while(j<olist.size())
                 {
                     if(alist.get(i).equals(olist.get(j)))
                     {
                         break;
                     }
                     j++;
                 }
                 if(amount%8==1)
                 {
                 %>
                     <tr>
                 <%
                 }
                 if(j==olist.size())
                 { 
                 %>
           <th scope="col"><img src="images/off.png" width="30" height="30" /><%=((User)alist.get(i)).getRealname() %>&nbsp; </th>     
             <%    }
                 else
                 {
                   %>
            <th scope="col"><img src="images/on.png" width="30" height="30" /><%=((User)alist.get(i)).getRealname() %>&nbsp; </th>
            <%         
                 } 
                 if(amount%8==0||amount==alist.size())
                 {
                 %>
                     </tr>
                 <%
                 }
             }
          %>
 